package com.Guigu.AIchat.inter;

import com.Guigu.AIchat.domain.ChatMessage;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ChatMessageRepository extends JpaRepository<ChatMessage, Long> {
    List<ChatMessage> findByUserIdOrderByTimestampDesc(Long userId);
    // 可以添加自定义查询方法
//    List<ChatMessage> findByUserIdOrderByTimestampAsc(Long userId);
    
}